package com.tdkj.action.backstage.shop;

import java.util.List;

import javax.annotation.Resource;

import com.tdkj.action.BaseAction;
import com.tdkj.model.shop.BeanGoodShowcaseCustom;
import com.tdkj.model.shop.BeanGoodShowcaseDefault;
import com.tdkj.service.shop.IBeanGoodShowcaseDefaultService;


public class GoodShowcaseDefaultAction extends BaseAction {
    
	private IBeanGoodShowcaseDefaultService goodShowcaseDefaultService;
	
	
	private Long id;
	private Integer quantity;
	
	private BeanGoodShowcaseDefault goodShowcaseDefault ;
	
	private List<BeanGoodShowcaseCustom> goodShowcaseCustoms ;
	
	public String init() {
		goodShowcaseDefaultService.initGoodShowcaseDefault();
		return execute();
	}
	
	public String update() {
		goodShowcaseDefaultService.updateGoodShowcaseDefault(quantity);
		return execute();
	}
	
	public String execute() {
		goodShowcaseDefault = goodShowcaseDefaultService.getGoodShowcaseDefault();
		goodShowcaseCustoms = goodShowcaseDefaultService.findAll(BeanGoodShowcaseCustom.class);
		return "success";
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the quantity
	 */
	public Integer getQuantity() {
		return quantity;
	}

	/**
	 * @param quantity the quantity to set
	 */
	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	/**
	 * @return the goodShowcaseDefault
	 */
	public BeanGoodShowcaseDefault getGoodShowcaseDefault() {
		return goodShowcaseDefault;
	}

	/**
	 * @param goodShowcaseDefault the goodShowcaseDefault to set
	 */
	public void setGoodShowcaseDefault(BeanGoodShowcaseDefault goodShowcaseDefault) {
		this.goodShowcaseDefault = goodShowcaseDefault;
	}

	/**
	 * @return the goodShowcaseCustoms
	 */
	public List<BeanGoodShowcaseCustom> getGoodShowcaseCustoms() {
		return goodShowcaseCustoms;
	}

	/**
	 * @param goodShowcaseCustoms the goodShowcaseCustoms to set
	 */
	public void setGoodShowcaseCustoms(
			List<BeanGoodShowcaseCustom> goodShowcaseCustoms) {
		this.goodShowcaseCustoms = goodShowcaseCustoms;
	}

	/**
	 * @param goodShowcaseDefaultService the goodShowcaseDefaultService to set
	 */
	@Resource
	public void setGoodShowcaseDefaultService(
			IBeanGoodShowcaseDefaultService goodShowcaseDefaultService) {
		this.goodShowcaseDefaultService = goodShowcaseDefaultService;
	}

}
